package com.sikaryofficial.workbench.domain.dto.req.goods;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.sikaryofficial.common.core.annotation.SqlEscapeDeserializer;
import com.sikaryofficial.common.core.web.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import java.util.List;

/**
 * @author : qinjinyuan
 * @desc : 商品列表请求入参
 * @date : 2024/09/23 17:07
 */
@Getter
@Setter
@ToString
@ApiModel(value = "商品列表请求入参", description = "商品列表请求入参")
public class GoodsListReq extends PageDomain {
    @JsonIgnore
    private Long userId;
    // 是否推荐
    @JsonIgnore
    private boolean hasRecommend;
    /**
     * 当在商品界面搜索品牌+产品名，搜索出商品结果；结果排列： 按照搜索的关键词按时间顺序从新到旧排列；
     */
    @ApiModelProperty(value = "brandNo-品牌 或 goodsName-产品名",example = "SKE")
    @Length(max = 100, message = "keyword could not greater than 100 characters")
    @JsonDeserialize(using = SqlEscapeDeserializer.class)
    private String keyWord;

    @ApiModelProperty(value = "款式: style:disposable 一次性,cartridge 弹药筒",example = "cartridge")
    private String style;

    @ApiModelProperty(value = "品牌",example = "SKE,多个英文逗号分隔")
    private String brandNos;
    /**
     * 口味名称
     */
    @ApiModelProperty(value = "口味名称",example = "多个英文逗号分隔")
    private String tasteNames;

    @ApiModelProperty(value = "口吸数",example = "多个英文逗号分隔")
    private String puffNumbers;

    @ApiModelProperty(value = "电池容量，单位： 毫安小时 mAh",example = "多个英文逗号分隔")
    private String batteryCapacityList;

    @ApiModelProperty(value = "烟油容量, 单位：毫升 ml",example = "多个英文逗号分隔")
    private String liquidCapacityList;

    @JsonIgnore
    private List<String> tasteNameList;
    @JsonIgnore
    private List<Integer> puffNumList;
    @JsonIgnore
    private List<Integer> batteryCapacityArr;
    @JsonIgnore
    private List<Integer> liquidCapacityArr;
    @JsonIgnore
    private List<String> brandNoList;

    /**
     *  排序，设置如下字段即可  （一次只支持一个排序字段）
     * orderByColumn  ： puff_num  or  battery_capacity or liquid_capacity  【根据实际SQL来定义】
     *
     * <choose>
     *             <when test="req.orderByColumn!= null and req.orderByColumn!=''">
     *                 order by ${req.orderByColumn} ${req.isAsc}, brandTasteId DESC
     *             </when>
     *             <otherwise>
     *                 order by p.created_time DESC,p.brand_no DESC,p.model DESC,p.taste_name DESC,p.style DESC
     *             </otherwise>
     *         </choose>
     *
     */
}

